package cn.hpe.po;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;

/**
 * Userinfo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "userinfo")
public class Userinfo implements java.io.Serializable {

	// Fields

	private String userEmail;
	private String userName;
	private String userPwd;
	private Short userAge;
	private String userSex;
	private Set<Datacomment> datacomments = new HashSet<Datacomment>(0);

	// Constructors

	/** default constructor */
	public Userinfo() {
	}

	/** full constructor */
	public Userinfo(String userEmail,String userName, String userPwd, Short userAge,
			String userSex, Set<Datacomment> datacomments) {
		this.userEmail = userEmail;
		this.userName = userName;
		this.userPwd = userPwd;
		this.userAge = userAge;
		this.userSex = userSex;
		this.datacomments = datacomments;
	}

	// Property accessors
	@Id
	@Column(name = "UserEmail", unique = true, nullable = false, length = 300)
	public String getUserEmail() {
		return this.userEmail;
	}

	public void setUserEmail(String userEmail) {
		this.userEmail = userEmail;
	}

	@Column(name = "UserName", length = 50)
	public String getUserName() {
		return this.userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	@Column(name = "UserPwd", length = 16)
	public String getUserPwd() {
		return this.userPwd;
	}

	public void setUserPwd(String userPwd) {
		this.userPwd = userPwd;
	}

	@Column(name = "UserAge")
	public Short getUserAge() {
		return this.userAge;
	}

	public void setUserAge(Short userAge) {
		this.userAge = userAge;
	}

	@Column(name = "UserSex", length = 2)
	public String getUserSex() {
		return this.userSex;
	}

	public void setUserSex(String userSex) {
		this.userSex = userSex;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "userinfo")
	public Set<Datacomment> getDatacomments() {
		return this.datacomments;
	}

	public void setDatacomments(Set<Datacomment> datacomments) {
		this.datacomments = datacomments;
	}

}